package usb;
import java.util.Scanner;
public class Test02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        for(int i=1;i<=3;i++){
            int score=0;
            for (int j =1;j<=3;j++){
                System.out.println("请输入第"+i+"个班，"+"第"+j+"个同学的成绩");
                while (true){
                    score=sc.nextInt();
                    if(score<0||score>100){
                        System.out.println("输入错误,请重新输入");
                    }else {
                        score+=score;
                        break;
                    }
                }
            }
            System.out.println("第"+i+"个班的总成绩为："+score+"分");
            System.out.println("第"+i+"个班平均成绩为："+score/3+"分");
        }
    }
}
